load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "session",
    srcs = [
        "session.go",
        "session_pool.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/ddl/session",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/ddl/logutil",
        "//pkg/domain/infosync",
        "//pkg/kv",
        "//pkg/metrics",
        "//pkg/parser/ast",
        "//pkg/parser/mysql",
        "//pkg/parser/terror",
        "//pkg/sessionctx",
        "//pkg/sessiontxn",
        "//pkg/util",
        "//pkg/util/chunk",
        "//pkg/util/intest",
        "//pkg/util/sqlexec",
        "@com_github_ngaut_pools//:pools",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_pingcap_kvproto//pkg/kvrpcpb",
    ],
)

go_test(
    name = "session_test",
    timeout = "short",
    srcs = ["session_pool_test.go"],
    flaky = True,
    shard_count = 2,
    deps = [
        ":session",
        "//pkg/testkit",
        "@com_github_ngaut_pools//:pools",
        "@com_github_stretchr_testify//require",
    ],
)
